package com.tcm.login.web.controller;

import com.base.core.exception.ServiceException;
import com.base.core.utils.R;
import com.tcm.user.model.query.LoginAuthQuery;
import com.tcm.user.service.SignupService;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.web.bind.annotation.*;


@RestController
@RequestMapping("/user")
public class SignupController {

    @DubboReference(version = "1.0.0", check = false, timeout = 3000)
    SignupService signupService;

    /**
     * 登录
     */
    @PostMapping("/signup")
    public R signup(@RequestBody LoginAuthQuery loginAuthQuery) {
        try {
            return signupService.signup(loginAuthQuery);
        }catch (ServiceException e){
            return R.fail("小伙伴太热情了，请稍后再试");
        }catch (Exception e){
            return R.fail("小伙伴太热情了，请稍后再试");
        }
    }



}
